﻿using Moq;

namespace HtmlUtilities.UnitTests
{
    public class MockHtml
    {
        public Mock<IHtmlPage> Page { get; private set; }
        public Mock<IBrowserInformation> BrowserInformation { get; private set; }
        public Mock<IHtmlDocment> Document { get; private set; }
        public Mock<IHtmlWindow> Window { get; private set; }

        public MockHtml()
        {
            Page = new Mock<IHtmlPage>();
            BrowserInformation = new Mock<IBrowserInformation>();
            Document = new Mock<IHtmlDocment>();
            Window = new Mock<IHtmlWindow>();

            Page.SetupGet(page => page.BrowserInformation).Returns(BrowserInformation.Object);
            Page.SetupGet(page => page.Document).Returns(Document.Object);
            Page.SetupGet(page => page.Window).Returns(Window.Object);

            Html.SetHtmlPageForTesting(Page.Object);
        }

        public void TearDown()
        {
            Html.SetHtmlPageForTesting(null);
        }
    }
}
